<template>
  <div>
    <Header></Header>
    <!--广告-->
    <div style=" width:1200px; margin:0px auto; margin-top:20px;">
      <el-carousel indicator-position="outside">
        <el-carousel-item v-for="(item, index) in adList" :key="index">
          <a :href="item.link">
            <img :src="item.img" style='width: 100%;height: 100%;object-fit: cover;' />
          </a>
        </el-carousel-item>
      </el-carousel>
    </div>
    <!--容器-->
    <div style="width: 1200PX; min-height:500px; margin:0px auto;">
      <!--课程列表-->
      <div style="width: 850PX;display: inline-block;  ">
        <el-tabs v-model="activeName">
          <el-tab-pane label="选课" name="allLesson">
            <!-- 课程形式筛选 -->
            <div class="tag-group" style="text-align: left">
              <span class="tag-group__title">形式</span>
              <el-tag style="margin: 5px;cursor:pointer" v-for="type in courseTypes" :key="type.id"
                :effect="courseType == type ? 'dark' : 'plain'" @click="selectCourseType(type)">
                {{ type.typeName }}
              </el-tag>
            </div>
            <!-- 课程方向筛选 -->
            <div class="tag-group" style="text-align: left;">
              <span class="tag-group__title">方向</span>
              <el-tag style="margin: 5px;cursor:pointer" v-for="orientation in courseOrientations" :key="orientation.id"
                :effect="courseOrientation == orientation ? 'dark' : 'plain'"
                @click="selectCourseOrientation(orientation)">
                {{ orientation.orientationName }}
              </el-tag>
            </div>
            <!-- 课程下级方向筛选 -->
            <div class="tag-group" style="text-align: left;" v-if="this.subCourseOrientations.length > 0">
              <span class="tag-group__title">类型</span>
              <el-tag style="margin: 5px;cursor:pointer" v-for="orientation in subCourseOrientations"
                :key="orientation.id" :effect="subCourseOrientation == orientation ? 'dark' : 'plain'"
                @click="selectSubCourseOrientation(orientation)">
                {{ orientation.orientationName }}
              </el-tag>
            </div>
            <div id="search">
              <a href="#" @click="selectOrder('sales')">热门</a>
              <a href="#" @click="selectOrder('createTime')">最新</a>
              <a href="#" @click="selectOrder('price')">
                价格<i :class="this.orderType == 'asc' ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
              </a>
              <div id="search-input">
                <el-input placeholder="请输入内容" suffix-icon="el-icon-search" @change="inputSearchText"
                  v-model="searchText" />
              </div>
            </div>
            <ul class="course-ul-pc">
              <!-- 课程信息展示开始 -->
              <li class="course-li" v-for="(item, index) in courseList" :key="index">
                <!-- 课程封面图 -->
                <img :src="item.courseImgUrl" class="teacher-portrait hover-pointer" />
                <!-- 课程文字信息 -->
                <div class="content-main">
                  <!-- 课程标题 -->
                  <div class="content-title hover-pointer">
                    <div class="p-title" style="text-align:left;" @click="gotoDetail(item)">
                      <span>{{ item.courseName }}</span>
                    </div>
                    <!-- 作者和职称 -->
                    <p class="p-title-buy text-overflow">
                      <span class="p-author-span">
                        {{ item.courseTeacher.teacherName }}
                      </span>
                      <span class="p-author-line" />
                      <span class="p-author-span">
                        {{ item.courseTeacher.position }}
                      </span>
                    </p>
                    <p></p>
                    <!-- 课程简单描述 -->
                    <p class="p-describe" style="text-align:left;" v-html="item.brief"></p>
                  </div>
                  <!-- 课程前两个章节信息 -->
                  <ul class="content-course" style="text-align:left;" v-if="item.courseSections.length > 0">
                    <!-- 章节1 : 免费试看，通常是第一章的前两节课 -->
                    <li class="content-course-lesson text-overflow" style="width:300px"
                      v-for="(lesson, index) in item.courseSections[0].courseLessons.slice(0, 2)" :key="index">
                      <!-- 免费试看图标 -->
                      <img src="@/assets/course-list/free-course.png" class="free-label hover-pointer" />
                      <span class="theme-span hover-pointer">
                        {{ lesson.theme }}
                      </span>
                    </li>
                  </ul>
                  <!-- 价格信息 -->
                  <div class="content-price" style="text-align:left;">
                    <p class="content-price-p">
                      <span class="content-price-orange-sm">￥</span>
                      <span class="content-price-orange">{{ item.discounts }}</span>
                      <span class="current-price">
                        <span class="current-price-unite">￥</span>
                        {{ item.price }}
                      </span>
                      <span class="activity-name">成就自己</span>
                      <span class="content-price-buy">{{ item.sales }}人购买</span>
                    </p>
                  </div>
                </div>
              </li>
              <!-- 课程信息结束 -->
            </ul>
          </el-tab-pane>
          <el-tab-pane label="已购" name="hasPay">
            <div v-if="!isLogin">
              <img src="@/assets/course-list/no-login@2x.png" class="no-data-icon" />
              <div class="no-data-title">您还没有登录</div>
              <div class="no-data-title">登录后即可查看已购课程</div>
              <div class="btn btn-yellow btn-center">立即登录</div>
            </div>
            <div v-if="isLogin">
              <ul class="course-ul-pc">
                <!-- 课程信息展示开始 -->
                <li class="course-li" v-for="(item, index) in myCourseList" :key="index">
                  <!-- 课程封面图 -->
                  <img :src="item.courseImgUrl" class="teacher-portrait hover-pointer" />
                  <!-- 课程文字信息 -->
                  <div class="content-main">
                    <!-- 课程标题 -->
                    <div class="content-title hover-pointer">
                      <div class="p-title" style="text-align:left;" @click="gotoDetail(item)">
                        <span>
                          {{ item.courseName }}
                        </span>
                      </div>
                      <!-- 作者和职称 -->
                      <p class="p-title-buy text-overflow">
                        <span class="p-author-span">
                          {{ item.courseTeacher.teacherName }}
                        </span>
                        <span class="p-author-line" />
                        <span class="p-author-span">
                          {{ item.courseTeacher.position }}
                        </span>
                      </p>
                      <p></p>
                      <!-- 课程简单描述 -->
                      <p class="p-describe" style="text-align:left;">
                        {{ item.brief }}
                      </p>
                    </div>
                    <!-- 课程前两个章节信息 -->
                    <ul class="content-course" style="text-align:left;">
                      <!-- 章节1 : 免费试看，通常是第一章的前两节课 -->
                      <li class="content-course-lesson text-overflow" style="width:300px"
                        v-for="(lesson, index) in item.courseSections[0].courseLessons.slice(0, 2)" :key="index">
                        <!-- 免费试看图标 -->
                        <img src="@/assets/course-list/free-course.png" class="free-label hover-pointer" />
                        <span class="theme-span hover-pointer">
                          {{ lesson.theme }}
                        </span>
                      </li>

                    </ul>
                    <!-- 价格信息 -->
                    <div class="content-price" style="text-align:left;">
                      <p class="content-price-p">
                        <span class="content-price-orange-sm">￥</span>
                        <span class="content-price-orange">{{ item.discounts }}</span>
                        <span class="current-price">
                          <span class="current-price-unite">￥</span>
                          {{ item.price }}
                        </span>
                        <span class="activity-name">成就自己</span>
                        <span class="content-price-buy">{{ item.sales }}人购买</span>
                      </p>
                      <div class="btn btn-yellow btn-offset">好好学习</div>
                    </div>
                  </div>
                </li>
                <!-- 课程信息结束 -->
              </ul>
            </div>
          </el-tab-pane>
        </el-tabs>
        <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize"
          :current-page="current" @current-change="getCourseList">
        </el-pagination>
      </div>

      <!--微信连接-->
      <div style="width:330px; height:350px; display: inline-block; float:right; ">
        <p class="title">精选文章</p>
        <ul class="article-content"></ul>
        <p class="split-line" style="margin-bottom:20px;">
          <span class="split-word">还可以在这里找到我们</span>
        </p>
        <ul class="social-list">
          <li class="social-item">
            <div id="qr-wrapper" class="qr-wrapper" style="display: none;" @mouseout="hideqr()">
              <img src="../assets/wechat-qr.47ac3f5.png" alt="二维码" class="qr-wrapper-img">
            </div>
            <img @mouseover="showqr()"
              src=""
              alt="微信" class="social-item-img">
            <p class="social-name">微信</p>
          </li>
          <li class="social-item hover-pointer" @click="gozhihu()">
            <img
              src=""
              alt="知乎" class="social-item-img">
            <p class="social-name">知乎</p>
          </li>
          <li class="social-item hover-pointer" @click="gowb()">
            <img
              src=""
              alt="知乎" class="social-item-img">
            <p class="social-name">知乎</p>
          </li>
          <li class="social-item hover-pointer" @click="gowb()">
            <img
              src=""
              alt="微博" class="social-item-img">
            <p class="social-name">微博</p>
          </li>
        </ul>
        <!--      <SeckillCourse></SeckillCourse>-->
      </div>

    </div>

    <Footer></Footer>
  </div>
</template>

<script>
import Header from "./Header/Header"; //顶部登录条
import Footer from "./Footer/index"; //顶部登录条
import SeckillCourse from "./SeckillCourse";
// 移除QRCode的直接导入，我们将使用包装器
// import QRCode from 'qrcodejs2'; // 引入qrcodejs
import { API_URLS } from "../config/index";

export default {
  name: "Index",
  components: {
    SeckillCourse,
    Header,
    Footer
    // 移除这里的QRCode组件注册
  },
  data() {
    return {
      activeName: "allLesson",
      courseList: [],  // 课程集合
      myCourseList: [], // 我购买过的课程列表
      isLogin: false, //登录状态
      user: null, // 已登录的用户对象信息
      myCourseIds: [], // 登录用户购买成功的课程编号集合
      adList: [],//轮播广告集合
      dialogFormVisible: false, //默认false：隐藏，true：显示
      time: null,// 计时对象
      orderNo: "",// 订单编号
      course: null,// 当前课程
      courseTypes: [], //课程类型集合
      courseOrientations: [], //上级课程方向集合
      subCourseOrientations: [], //下级课程方向集合
      courseType: "", //当前课程类型
      courseOrientation: "", //当前上级课程方向
      subCourseOrientation: "", //下级课程方向
      searchText: "", //搜索内容
      total: 15,
      pageSize: 5,
      current: 1,
      orderField: "sales", //三种排序方式 销量sales,最新 createTime,价格 price
      orderType: "asc"//两种排序类型 asc，desc
    };
  },
  created() {
    this.initData();
  },
  methods: {
    // 初始化数据
    async initData() {
      try {
        // 并行加载数据
        await Promise.all([
          this.getAdList(),
          this.getCourseTypes(),
          this.getCourseOrientations(),
          this.getCourseList(this.current)
        ]);

        // 检查登录状态
        const userStr = localStorage.getItem("user");
        if (userStr) {
          try {
            this.user = JSON.parse(userStr);
            this.isLogin = true;
          } catch (e) {
            console.warn('Failed to parse user data:', e);
          }
        }
      } catch (error) {
        console.error('Error initializing data:', error);
      }
    },
    // 获取课程类型
    async getCourseTypes() {
      try {
        const response = await this.$axios.get(API_URLS.COURSE.TYPES);
        if (response.data) {
          this.courseTypes = response.data;
        }
      } catch (error) {
        console.error('Error fetching course types:', error);
      }
    },
    // 选择课程类型
    selectCourseType(courseType) {
      this.courseType = this.courseType === courseType ? "" : courseType;
      this.getCourseList(this.current);
    },
    // 获取课程方向
    async getCourseOrientations() {
      try {
        const response = await this.$axios.get(API_URLS.COURSE.ORIENTATIONS);
        if (response.data) {
          this.courseOrientations = response.data;
        }
      } catch (error) {
        console.error('Error fetching course orientations:', error);
      }
    },
    // 选择课程方向
    async selectCourseOrientation(orientation) {
      try {
        this.courseOrientation = this.courseOrientation === orientation ? "" : orientation;
        if (this.courseOrientation) {
          const response = await this.$axios.get(`${API_URLS.COURSE.SUB_ORIENTATIONS}/${orientation.id}`);
          if (response.data) {
            this.subCourseOrientations = response.data;
          }
        } else {
          this.subCourseOrientations = [];
        }
        this.getCourseList(this.current);
      } catch (error) {
        console.error('Error handling course orientation selection:', error);
      }
    },
    // 获取广告列表
    async getAdList() {
      try {
        const response = await this.$axios.get(`${API_URLS.AD.GET_BY_SPACE}/1`);
        if (response.data) {
          this.adList = response.data;
        }
      } catch (error) {
        console.error('Error fetching ads:', error);
      }
    },
    // 获取课程列表
    async getCourseList(page) {
      try {
        const params = {
          current: page,
          size: this.pageSize,
          orderField: this.orderField,
          orderType: this.orderType
        };

        if (this.courseType) {
          params.typeId = this.courseType.id;
        }
        if (this.courseOrientation) {
          params.orientationId = this.courseOrientation.id;
        }
        if (this.subCourseOrientation) {
          params.subOrientationId = this.subCourseOrientation.id;
        }
        if (this.searchText) {
          params.keywords = this.searchText;
        }

        const response = await this.$axios.get(API_URLS.COURSE.LIST, { params });
        if (response.data) {
          this.courseList = response.data.records.map(course => ({
            ...course,
            courseTeacher: course.courseTeacher || { teacherName: '未知', position: '未知' },
            courseSections: course.courseSections || [],
            brief: course.brief || '',
            courseImgUrl: course.courseImgUrl || '',
            discounts: course.discounts || 0,
            price: course.price || 0,
            sales: course.sales || 0
          }));
          this.total = response.data.total || 0;
          this.current = response.data.current || 1;
        }
      } catch (error) {
        console.error('Error fetching courses:', error);
        this.$message.error('获取课程列表失败');
      }
    },
    // 跳转到课程详情
    gotoDetail(course) {
      this.$router.push({
        name: "Course",
        params: { course }
      });
    },
    // 处理页面变化
    handlePageChange(page) {
      this.current = page;
      this.getCourseList(page);
    },
    // 处理排序
    handleSort(field) {
      this.orderField = field;
      if (field === "price") {
        this.orderType = this.orderType === "asc" ? "desc" : "asc";
      } else {
        this.orderType = "desc";
      }
      this.getCourseList(this.current);
    },
    // 处理搜索
    handleSearch(text) {
      this.searchText = text;
      this.current = 1;
      this.getCourseList(1);
    },
    // 显示微信公众号二维码
    showqr() {
      document.getElementById("qr-wrapper").style.display = "block";
    },
    // 隐藏微信公众号二维码
    hideqr() {
      document.getElementById("qr-wrapper").style.display = "none";
    },
    // 跳转到知乎
    gozhihu() {
      window.open('https://www.zhihu.com/org/la-gou-kai-wu-xun-lian-ying');
    },
    // 跳转到微博
    gowb() {
      window.open('https://weibo.com/p/1006066707072494/home?from=page_100606&mod=TAB&is_hot=1#place');
    },
    // 处理搜索输入
    inputSearchText(value) {
      this.searchText = value;
      this.getCourseList(1);
    },
    // 选择排序方式
    selectOrder(field) {
      if (field === 'price') {
        this.orderType = this.orderType === 'asc' ? 'desc' : 'asc';
      }
      this.orderField = field;
      this.getCourseList(1);
    },
    // 选择下级课程方向
    selectSubCourseOrientation(orientation) {
      this.subCourseOrientation = this.subCourseOrientation === orientation ? "" : orientation;
      this.getCourseList(1);
    }
  }
};
</script>

<style lang="less" scoped>
@import "../assets/less/common.less";


.qr-wrapper {
  position: absolute;
  width: 140px;
  height: 140px;
  display: block;
  z-index: 10;
  background: #fff;
  border: 1px solid #e3ebe9;
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, .08);
  border-radius: 3px;
  box-sizing: border-box;
  left: -30px;
  top: -150px;
}

p {
  margin-top: 0;
}

li {
  list-style: none;
}

.social-item {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 62px;
}

.social-item-img {
  width: 32px;
  height: 32px;
}

.split-word {
  display: inherit;
  color: #999;
  font-size: 14px;
  margin: 0 10px;
  position: relative;
}

.split-word:before {
  content: "";
  display: inline-block;
  position: absolute;
  width: 30px;
  height: 1px;
  background-color: #d8d8d8;
  margin: 10px 0 0 -44px;
}

.split-word:after {
  margin: 10px 0 0 13px;
  content: "";
  display: inline-block;
  position: absolute;
  width: 30px;
  height: 1px;
  background-color: #d8d8d8;
}

.article-content {
  font-size: 14px;
  margin-bottom: 40px;
}

ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.title {
  font-size: 16px;
  color: #333;
  margin-bottom: 20px;
  font-weight: 500;
}

flex {
  display: flex;
}

.btn(@a, @b) {
  background-color: @a;
  color: @b;
  border: 1px solid @a;
}

.course-ads {
  margin-bottom: 20px;
  cursor: pointer;
  width: 100%;
  max-height: 280px;
  overflow: hidden;

  img {
    width: 100%;
    border-radius: 2px;
  }
}

.tab-container {
  width: 100%;
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid #ededed;
}

.vux-tab.course-tab {
  box-sizing: border-box;
  height: 60px;
  width: 200px;
  overflow: hidden;
  font-size: 20px;

  .vux-tab-container {
    width: 260px;
  }

  .vux-tab-item {
    cursor: pointer;
    background: none;
    line-height: 60px;
    font-size: 20px;
  }

  .vux-tab-ink-bar {
    bottom: -1px;

    .vux-tab-bar-inner {
      height: 2px;
    }
  }
}

.tab-container {
  width: 100%;
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid #ededed;
}

.course-ul {
  padding: 0 20px;
}

.hover-pointer {
  cursor: pointer;
}

.course-ul-pc .course-li {
  padding: 30px 0 40px 0;
  border-bottom: 1px solid #ededed;
  position: relative;

  &:last-child {
    border-bottom: 0;
  }
}

.current-price {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  text-decoration: line-through;
}

.current-price-unite {
  font-size: 12px;
  margin-right: -4px;
}

.p-author-line {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  position: absolute;
  background: #999;
  margin-left: 5px;
  top: 3px;
}

.teacher-portrait {
  width: 121px;
  height: 159px;
  border-radius: 4px;
  float: left;
}

.content-main {
  line-height: 1.4;
  margin-left: 141px;
  position: relative;
  height: 150px;
}

.content-main .p-title {
  font-size: 20px;
  color: #333;
  font-family: PingFangSC-Medium, PingFang SC;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 350px;
}

.course-ul-pc .content-main .p-title-buy {
  font-size: 12px;
  color: #999;
  display: inline-block;
  margin-top: 6px;
  position: relative;
  float: right;
  top: -28px;
  font-weight: 400;
}

p {
  margin-top: 0;
}

.course-ul-pc .p-author-line {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  position: absolute;
  background: #999;
  margin-left: 5px;
  top: 3px;
}

.text-overflow {
  word-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.course-ul-pc .content-main .p-describe {
  font-size: 14px;
  margin-top: 5px;
  color: #333;
  word-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.course-ul-pc .content-main .p-author-span:not(:first-child) {
  margin-left: 18px;
}

.course-ul-pc .content-main .content-course {
  font-size: 14px;
  padding-top: 25px;
  color: #666;
}

.content-course {
  font-size: 14px;
  padding-top: 25px;
  color: #666;
}

.content-course.free-label {
  width: 50px;
  height: 16px;
  margin: 1px 5px 0 0;
}

.content-course-lesson {
  display: inline-block;
  width: 304px;
  margin: 2px 40px 6px 0;
}

.content-course-lesson:nth-child(2n) {
  margin-right: 0;
}

.disabled-word {
  color: #999;
  cursor: default;
}

.theme-span :hover {
  color: #0abf89;
}

.content-price-p {
  font-size: 0;
}

.content-price-orange {
  color: #ff7452;
  font-size: 20px;
}

.content-price-buy {
  font-size: 14px;
  color: #999;
  margin-left: 20px;
  transform: translate(8px, -2px);
  display: inline-block;
}

.content-price-grey {
  color: #999;
  font-size: 12px;
  margin-left: 5px;
}

.content-price-buyed {
  color: #999;
  font-size: 14px;
}

.content-price {
  height: 28px;
  line-height: 28px;
  position: absolute;
  width: 100%;
  bottom: -4px;
}

.activity-name {
  font-size: 12px;
  line-height: 14px;
  color: rgba(255, 255, 255, 1);
  padding: 2px 4px;
  background: linear-gradient(180deg,
      rgba(255, 137, 110, 1) 0%,
      rgba(255, 123, 92, 1) 100%);
  border-radius: 2px;
  display: inline-block;
  transform: translate(6px, -3px);
}

.p-title {
  font-size: 20px;
  color: #333;
  font-family: PingFangSC-Medium, PingFang SC;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 350px;
}

.p-title-dec {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.p-title-buy {
  // .font(12px);
  font-size: 12px;
  color: #999;
  display: inline-block;
  margin-top: 6px;
  position: relative;
  // .fr;
  top: -28px;
  font-weight: normal;
}

.companion-reading {
  background: rgba(0, 179, 138, 0.06);
  border-radius: 2px;
  font-family: PingFangSC-Regular;
  font-size: 12px;
  color: #00b38a;
  display: inline-block;
  padding: 0 8px;
  height: 22px;
  line-height: 22px;
  margin-left: 10px;
  vertical-align: text-bottom;
  position: relative;

  .triangle {
    position: absolute;
    top: 12px;
    left: -3px;
    width: 0;
    height: 0;
    content: "";
    border: 5px solid;
    border-color: transparent transparent white white;
    transform: rotate(45deg);
    box-shadow: -2px 2px 2px rgba(0, 0, 0, 0.08);
  }
}

.companion-tip {
  display: none;
  position: absolute;
  font-family: HiraginoSansGB-W3;
  font-size: 14px;
  color: #777777;
  background: #ffffff;
  border: 1px solid #e3ebe9;
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  line-height: 29px;
  top: -7px;
  word-break: keep-all;
  left: 80px;
  padding: 0 10px;
  width: 200px;
  z-index: 2;
}

.companion-reading:hover .companion-tip {
  display: inline-block;
}

.companion-reading:hover .companion-tip {
  display: block;
}

.p-describe {
  // .font(14px);
  font-size: 14px;
  margin-top: 5px;
  color: #333;
  // .text-overflow;
}

.p-author+p {
  margin-top: 0;
}

.p-author {
  margin: 10px 0 5px 0;
  // .font(12px);
  font-size: 12px;
  color: #999;
  position: relative;

  .p-author-line {
    content: "";
    display: inline-block;
    width: 1px;
    height: 10px;
    position: absolute;
    background: #999;
    margin-left: 5px;
    top: 3px;
  }
}

.p-author-span:not(:first-child) {
  margin-left: 18px;
}

.course-ul-container {
  width: 850px;
  display: inline-block;
  float: left;
}

.course-ul {
  padding: 0 20px;
}

.course-ul-pc {
  width: 790px;
  background-color: #fff;
  padding: 0 30px;
  // .fl;
}

.tag-icon {
  width: 57px;
  height: 18px;
  position: absolute;
  top: 30px;
  left: 0;
}

.more-icon {
  width: 10px;
  height: 10px;
  vertical-align: middle;
}

.btn {
  width: 94px;
  height: 34px;
  text-align: center;
  line-height: 34px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  box-sizing: content-box;

  &-green {
    .btn(#00b38a, #fff);

    &:hover {
      background: #00a57f;
      border-color: #00a57f;
    }
  }

  &-yellow {
    .btn(#fcd766, #fff);

    &:hover {
      background: #f0d071;
      border-color: #f0d071;
    }
  }

  &-white {
    .btn(#fff, #00b38a);
    border: 1px solid #00b38a;

    &:hover {
      color: #fff;
      border-color: #00b38a;
      background-color: #00b38a;
    }
  }

  &-offset {
    position: absolute;
    right: 0;
    top: -4px;
  }
}

.btn-center {
  margin: 10px auto;
}

.no-data-title {
  font-size: 20px;
  color: #333;
  font-weight: 500;
}

#search {
  width: 100%;
  height: 50px;
}

#search a {
  color: #0abf89;
  margin-right: 30px;
  line-height: 40px;
  float: left;
}

#search-input {
  width: 200px;
  height: 40px;
  float: left;
}
</style>
